package com.heima.user.controller;


import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.AuthDto;
import com.heima.user.service.IApUserRealnameService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * APP实名认证信息表 前端控制器
 * </p>
 *
 * @author wangjian
 * @since 2022-06-28
 */
@RestController
@RequestMapping("/api/v1/user_realname")
@Api(tags = "APP实名认证信息表接口")
@CrossOrigin
public class ApUserRealnameController  {

    @Autowired
    private IApUserRealnameService apUserRealnameService;

  /**
   * @description: 按照状态查询用户
   * @author: wangjian
   * @param: dto
   * @return: com.heima.common.dto.ResponseResult
   **/
    @PostMapping("/list")
    public ResponseResult listStatus(@RequestBody AuthDto dto){
        return apUserRealnameService.listStatus(dto);
    }
   /**
    * @description: 审核通过
    * @author: wangjian
           * @date: 2022/6/29 15:39
    * @param: dto
    * @return: com.heima.common.dto.ResponseResult
    **/
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return apUserRealnameService.auth(dto, 1);
    }

 /**
  * @description: 审核失败
  * @author: wangjian
         * @date: 2022/6/29 15:39
  * @param: dto
  * @return: com.heima.common.dto.ResponseResult
  **/
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto) {
        return apUserRealnameService.auth(dto, 0);
    }
}
